<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<button id="btn1">按钮</button>
<button id="btn2">按钮</button>
<script>
/*btn.onclick = function (){
    console.log(this);
}*/
function showMsg(){
    console.log(this);
}
btn1.onclick = showMsg;
btn2.onclick = showMsg;
//btn1.onclick = /*undefined*/ null

</script>
</body>
</html>